<?php
///**
// * Created by PhpStorm.
// * User: Adiljan
// * Date: 2021/10/06
// * Time: 15:58


$server = "localhost";
$user = "root";
$pwd = "root";
$db = "dil";
// 数据表填入数据
$name = $_GET['name'];
$age = $_GET['age'];
$gender = $_GET['gender'];
$hometown = $_GET['hometown'];
$description = $_GET['description'];

$ulinix = mysqli_connect($server,$user,$pwd,$db);
if($ulinix){
    echo "数据库链接成功！";
    $query = "insert into nur(name,age,gender,hometown,description) 
values('". $name ."',". $age .",". $gender .",'". $hometown ."','". $description ."')";
    echo $query;
    $queryOK = mysqli_query($ulinix, $query);
    if($queryOK){
        echo "数据添加成功！";
    }else{
        echo "数据添加失败：".mysqli_error($ulinix);
    }
}else{
    echo "数据库链接失败： " . mysqli_connect_error();
}